package yunjiao.javatutorials.designpatterns.interpreter;

import lombok.extern.slf4j.Slf4j;

/**
 * 上下文
 *
 * @author yangyunjiao
 */
@Slf4j
public class Context {
    private final String input;

    public Context(String input) {
        this.input = input;
    }

    public boolean getResult(Expression expression) {
        return expression.interpreter(input);
    }

    @Override
    public String toString() {
        return input;
    }
}
